import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: 'Quasar Template',
  description: '基于 Quasar 的项目模板',

  themeConfig: {
    // 导航栏
    nav: [
      { text: '指南', link: '/guide/getting-started' },
      { text: '组件', link: '/components/fy-cascade-select' },
    ],

    // 侧边栏
    sidebar: {
      '/guide/': [
        {
          text: '指南',
          items: [
            { text: '快速开始', link: '/guide/getting-started' },
            { text: '响应式布局', link: '/guide/responsive-layout' },

            { text: '网格布局系统', link: '/guide/grid-layout' },
            { text: 'Quasar 样式类参考', link: '/guide/quasar-class' },
            { text: '目录结构', link: '/guide/directory-structure' },
            { text: '核心概念', link: '/guide/concepts' },
            { text: '部署指南', link: '/guide/deployment' },
          ],
        },
        {
          text: '开发',
          items: [{ text: '组件开发指南', link: '/guide/component-dev' }],
        },
      ],
      '/components/': [
        {
          text: '组件',
          items: [
            { text: '级联选择器', link: '/components/fy-cascade-select' },
            { text: '表格组件', link: '/components/fy-table' },
            { text: '树表格组件', link: '/components/fy-tree-table' },
            { text: 'FySteps 步骤条', link: '/components/fy-steps' },
            { text: '移动端导航头', link: '/components/fy-mobile-header' },
            { text: '回到顶部', link: '/components/fy-back-to-top' },
          ],
        },
      ],
    },

    // 社交链接
    socialLinks: [{ icon: 'github', link: 'https://github.com/your-repo' }],

    // 页脚
    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2024-present Your Name',
    },

    // 搜索
    search: {
      provider: 'local',
    },

    // 文档特性
    features: [
      {
        title: '开箱即用',
        details: '集成了常用的企业级组件和最佳实践',
      },
      {
        title: '响应式设计',
        details: '基于 Quasar 框架,支持多端适配',
      },
      {
        title: '规范化开发',
        details: '内置代码规范和目录结构规范',
      },
    ],

    // 大纲配置
    outline: {
      level: [2, 3],
      label: '目录',
    },

    // 上下页
    docFooter: {
      prev: '上一页',
      next: '下一页',
    },
  },

  markdown: {
    lineNumbers: true,
    theme: {
      dark: 'github-dark',
      light: 'github-light',
    }, // 深色主题
    codeBlock: {
      background: '#010101 !important', // 强制设置代码块背景色
    },
  },

  // 多语言
  locales: {
    root: {
      label: '简体中文',
      lang: 'zh-CN',
    },
  },

  // 头部标签
  head: [
    ['link', { rel: 'icon', href: '/favicon.ico' }],
    ['meta', { name: 'theme-color', content: '#3eaf7c' }],
    ['link', { rel: 'stylesheet', href: '/style.css' }],
  ],

  // 构建配置
  build: {
    outDir: '../dist/docs',
  },

  // 开发服务器配置
  server: {
    port: 5173,
  },
})
